{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas\n",
    "import numpy as np\n",
    "df_gzmt = pandas.read_csv(r'../09/600519.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "index =  0\n",
      "row value is \n",
      "day           2001-08-27\n",
      "STOCK_CODE       6005191\n",
      "open               34.51\n",
      "close              35.55\n",
      "maximum            37.78\n",
      "minimum            32.85\n",
      "volume            406318\n",
      "TURNOVER      1410347008\n",
      "Name: 0, dtype: object\n",
      "format of row is  <class 'pandas.core.series.Series'>\n",
      "35.55\n"
     ]
    }
   ],
   "source": [
    "for index, row in df_gzmt.iterrows():\n",
    "    print(\"index = \", index)\n",
    "    print(\"row value is \", row, sep=\"\\n\")\n",
    "    print(\"format of row is \", type(row))\n",
    "    print(row['close'])\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_GDP = pandas.read_csv('GDP.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "country_dict = {\n",
    "    \"United Kingdom\": \"英国\", \n",
    "    \"United States\": \"美国\", \n",
    "    \"Russian Federation\": \"俄罗斯\", \n",
    "    \"France\": \"法国\", \n",
    "    \"China\": \"中国\" \n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_GDP[\"国家\"] = df_GDP[\"Country Name\"].map(country_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义函数:将数字类型美元计价GDP的变量转换为以万亿人民币为单位计价的数据\n",
    "def dollar_to_rmb(x):\n",
    "    if np.isnan(x):\n",
    "        return np.nan\n",
    "    else:\n",
    "        _value = x / 1000000000000 * 6.8918\n",
    "        return \"%.2f万亿人民币\"%(_value)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'20.88万亿人民币'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dollar_to_rmb(3030000000000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_GDP['2018-cn']= df_GDP[\"2018\"].apply(dollar_to_rmb)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_jobs = pandas.read_csv('jobs_51_info.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['北京', '深圳', '上海', '武汉', '广州', '南京', '西安', '杭州', '成都', '苏州', nan],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs['city'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 6 artists>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO3db4xddZ3H8ffHtquuspDYm7XpH8cEYqJGASdVw8YQCJsqBDYRE0xEMZomRlbMmhjwAUYe6RM1ipE0wFqUFQyoqVjXJQGjPKA6rQVsi0nXsKENmw6tgl0VU/e7D+a4mQwzvWdmb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ol6KSpJXBJ0UlqREGuiQ14iUf6EnuTHKkm0u/4iXZmOThJPuT7Etyw7h7Wq4kr0jy8ySPddf0uXH3NApJViX5ZZIHxt3LKCR5KskTSfYmmRp3P8uV5Jwk9yV5MsmBJO8cd0/DvOTH0JO8CzgO3FVVbx53P8uVZB2wrqr2JDkL2A38U1XtH3NrS9Y9dfyqqjqeZA3wCHBDVT065taWJcm/AJPA31XVFePuZ7mSPAVMzn2gcKVKsh34WVXd3s3w+9uq+t2Y2zqpl/wdelX9lJmZOU2oqmeqak+3/HvgALB+vF0tT8043q2u6T4r+k4kyQbgcuD2cfeiF0tyNvAuZmbwUVV/PtPDHAz0pnW/enkBsGvMrSxbNzyxFzgCPFhVK/2avgx8GvjfMfcxSgX8R5Ld3c98rGSvB6aBf+2GxW5P8qpxNzWMgd6oJK8G7gc+WVXPj7uf5aqqv1TV+cw8qbw5yYodHktyBXCkqnaPu5cR+4equpCZX2b9eDecuVKtBi4Evl5VFwD/A7zop8PPNAZ6g7px5vuBu6vqu+PuZ5S6//Y+DGwZcyvLcRFwZTfmfA9wSZJvjbel5auqw92fR4DvMfNLrSvVIeDQrP8J3sdMwJ/RDPTGdF8g3gEcqKovjrufUUgySHJOt/xK4DLgybE2tQxVdVNVbaiqCWaeqn6oqj4w5raWJcmrui/h6YYm/hFYsTPHquq/gaeTvKHbdClwxk8sOK2/tngmSvJt4GJgbZJDwGer6o7xdrUsFwHXAk90Y84An6mqneNradnWAdu7l628DPhOVTUx1a8hfw98r3sNwmrg36rq38fb0rL9M3B3N8PlN8CHx9zPUC/5aYuS1AqHXCSpEQa6JDXCQJekRhjoktQIA12SGmGgS1IjDHRJasT/AaH4S64YZOsQAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "x = [1,2,3,4,5,6]\n",
    "y = [3,3,3,4,4,4] \n",
    "\n",
    "plt.bar(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10329.230455194938"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs[df_jobs[\"city\"]==\"北京\"][\"salary_min\"].mean(skipna=True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "63017"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs.dropna(axis=0).shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(66766, 5)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs.dropna(how=\"all\", axis=0).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_jobs[\"city\"].fillna(\"其他\", inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "广州    15634\n",
       "深圳    14448\n",
       "上海    13027\n",
       "北京     5093\n",
       "杭州     4615\n",
       "武汉     3682\n",
       "成都     2811\n",
       "其他     2476\n",
       "南京     2165\n",
       "苏州     1486\n",
       "西安     1329\n",
       "Name: city, dtype: int64"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs['city'].unique()\n",
    "df_jobs['city'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0        8333.33\n",
       "1         8000.0\n",
       "2         6000.0\n",
       "3         5000.0\n",
       "4        13000.0\n",
       "          ...   \n",
       "66761     3000.0\n",
       "66762     8000.0\n",
       "66763    20000.0\n",
       "66764    30000.0\n",
       "66765     8000.0\n",
       "Name: salary_min, Length: 66766, dtype: object"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "smMean = df_jobs['salary_min'].mean\n",
    "df_jobs[\"salary_min\"].fillna(smMean)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_jobs['新增列'] = 'yes'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "str = '金融员'\n",
    "\n",
    "def isDAJob(str):\n",
    "  if '数据分析' in str:\n",
    "    return True\n",
    "  else:\n",
    "    return False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "isDAJob(str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_jobs.insert(1, \"是否为数据分析岗位\", df_jobs[\"job\"].apply(isDAJob))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<bound method NDFrame.head of                        job  是否为数据分析岗位              company city  salary_min  \\\n",
       "0               金融数据分析师/助理       True  华壹信融投资管理（北京）有限责任...   北京     8333.33   \n",
       "1      a（0经验可培养）金融数据分析师/助理       True         深圳市中创荣投资有限公司   深圳     8000.00   \n",
       "2            初级运营数据分析专员 助理       True       知才（上海）信息技术有限公司   上海     6000.00   \n",
       "3                   销售数据分析       True      上海品星互联网信息技术有限公司   北京     5000.00   \n",
       "4                   数据分析经理       True                  美菜网   上海    13000.00   \n",
       "...                    ...        ...                  ...  ...         ...   \n",
       "66761                运营支持岗      False        九州通医药集团物流有限公司   武汉     3000.00   \n",
       "66762              新媒体运营专员      False  深圳市摩天之星企业管理有限公司龙...   深圳     8000.00   \n",
       "66763               电商运营总监      False         福建特家商业管理有限公司   广州    20000.00   \n",
       "66764              总经理/CEO      False         福建特家商业管理有限公司   广州    30000.00   \n",
       "66765            会员商城运营管理师      False       统一企业（中国）投资有限公司   上海     8000.00   \n",
       "\n",
       "       salary_max  新增列  \n",
       "0         12500.0  yes  \n",
       "1         10000.0  yes  \n",
       "2          8000.0  yes  \n",
       "3          9000.0  yes  \n",
       "4         17000.0  yes  \n",
       "...           ...  ...  \n",
       "66761      5000.0  yes  \n",
       "66762     10000.0  yes  \n",
       "66763     30000.0  yes  \n",
       "66764     50000.0  yes  \n",
       "66765     16000.0  yes  \n",
       "\n",
       "[66766 rows x 7 columns]>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs.head"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>job</th>\n",
       "      <th>是否为数据分析岗位</th>\n",
       "      <th>company</th>\n",
       "      <th>city</th>\n",
       "      <th>salary_min</th>\n",
       "      <th>salary_max</th>\n",
       "      <th>新增列</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>金融数据分析师/助理</td>\n",
       "      <td>True</td>\n",
       "      <td>华壹信融投资管理（北京）有限责任...</td>\n",
       "      <td>北京</td>\n",
       "      <td>8333.33</td>\n",
       "      <td>12500.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>a（0经验可培养）金融数据分析师/助理</td>\n",
       "      <td>True</td>\n",
       "      <td>深圳市中创荣投资有限公司</td>\n",
       "      <td>深圳</td>\n",
       "      <td>8000.00</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>初级运营数据分析专员 助理</td>\n",
       "      <td>True</td>\n",
       "      <td>知才（上海）信息技术有限公司</td>\n",
       "      <td>上海</td>\n",
       "      <td>6000.00</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>销售数据分析</td>\n",
       "      <td>True</td>\n",
       "      <td>上海品星互联网信息技术有限公司</td>\n",
       "      <td>北京</td>\n",
       "      <td>5000.00</td>\n",
       "      <td>9000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>数据分析经理</td>\n",
       "      <td>True</td>\n",
       "      <td>美菜网</td>\n",
       "      <td>上海</td>\n",
       "      <td>13000.00</td>\n",
       "      <td>17000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66761</th>\n",
       "      <td>运营支持岗</td>\n",
       "      <td>False</td>\n",
       "      <td>九州通医药集团物流有限公司</td>\n",
       "      <td>武汉</td>\n",
       "      <td>3000.00</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66762</th>\n",
       "      <td>新媒体运营专员</td>\n",
       "      <td>False</td>\n",
       "      <td>深圳市摩天之星企业管理有限公司龙...</td>\n",
       "      <td>深圳</td>\n",
       "      <td>8000.00</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66763</th>\n",
       "      <td>电商运营总监</td>\n",
       "      <td>False</td>\n",
       "      <td>福建特家商业管理有限公司</td>\n",
       "      <td>广州</td>\n",
       "      <td>20000.00</td>\n",
       "      <td>30000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66764</th>\n",
       "      <td>总经理/CEO</td>\n",
       "      <td>False</td>\n",
       "      <td>福建特家商业管理有限公司</td>\n",
       "      <td>广州</td>\n",
       "      <td>30000.00</td>\n",
       "      <td>50000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66765</th>\n",
       "      <td>会员商城运营管理师</td>\n",
       "      <td>False</td>\n",
       "      <td>统一企业（中国）投资有限公司</td>\n",
       "      <td>上海</td>\n",
       "      <td>8000.00</td>\n",
       "      <td>16000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>66766 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                       job  是否为数据分析岗位              company city  salary_min  \\\n",
       "0               金融数据分析师/助理       True  华壹信融投资管理（北京）有限责任...   北京     8333.33   \n",
       "1      a（0经验可培养）金融数据分析师/助理       True         深圳市中创荣投资有限公司   深圳     8000.00   \n",
       "2            初级运营数据分析专员 助理       True       知才（上海）信息技术有限公司   上海     6000.00   \n",
       "3                   销售数据分析       True      上海品星互联网信息技术有限公司   北京     5000.00   \n",
       "4                   数据分析经理       True                  美菜网   上海    13000.00   \n",
       "...                    ...        ...                  ...  ...         ...   \n",
       "66761                运营支持岗      False        九州通医药集团物流有限公司   武汉     3000.00   \n",
       "66762              新媒体运营专员      False  深圳市摩天之星企业管理有限公司龙...   深圳     8000.00   \n",
       "66763               电商运营总监      False         福建特家商业管理有限公司   广州    20000.00   \n",
       "66764              总经理/CEO      False         福建特家商业管理有限公司   广州    30000.00   \n",
       "66765            会员商城运营管理师      False       统一企业（中国）投资有限公司   上海     8000.00   \n",
       "\n",
       "       salary_max  新增列  \n",
       "0         12500.0  yes  \n",
       "1         10000.0  yes  \n",
       "2          8000.0  yes  \n",
       "3          9000.0  yes  \n",
       "4         17000.0  yes  \n",
       "...           ...  ...  \n",
       "66761      5000.0  yes  \n",
       "66762     10000.0  yes  \n",
       "66763     30000.0  yes  \n",
       "66764     50000.0  yes  \n",
       "66765     16000.0  yes  \n",
       "\n",
       "[66766 rows x 7 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs.sort_index(axis=0, ascending=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>job</th>\n",
       "      <th>是否为数据分析岗位</th>\n",
       "      <th>company</th>\n",
       "      <th>city</th>\n",
       "      <th>salary_min</th>\n",
       "      <th>salary_max</th>\n",
       "      <th>新增列</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>859</th>\n",
       "      <td>数据分析师</td>\n",
       "      <td>True</td>\n",
       "      <td>（CCE GROUP）上海程迈文化传播有...</td>\n",
       "      <td>上海</td>\n",
       "      <td>15000.0</td>\n",
       "      <td>20000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50689</th>\n",
       "      <td>资深媒介专员</td>\n",
       "      <td>False</td>\n",
       "      <td>（CCE GROUP）上海程迈文化传播有...</td>\n",
       "      <td>上海</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23092</th>\n",
       "      <td>产品运营经理（教育行业）</td>\n",
       "      <td>False</td>\n",
       "      <td>龙的股份</td>\n",
       "      <td>上海</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4113</th>\n",
       "      <td>教务助理/教务人员</td>\n",
       "      <td>False</td>\n",
       "      <td>鼓动商贸（上海）有限公司</td>\n",
       "      <td>上海</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>7000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27576</th>\n",
       "      <td>教务专员</td>\n",
       "      <td>False</td>\n",
       "      <td>鼓动商贸（上海）有限公司</td>\n",
       "      <td>上海</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>6500.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39420</th>\n",
       "      <td>商品经理</td>\n",
       "      <td>False</td>\n",
       "      <td>ABC童装童鞋</td>\n",
       "      <td>西安</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39717</th>\n",
       "      <td>急聘商品专员</td>\n",
       "      <td>False</td>\n",
       "      <td>ABC童装童鞋</td>\n",
       "      <td>西安</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39719</th>\n",
       "      <td>商品主管</td>\n",
       "      <td>False</td>\n",
       "      <td>ABC童装童鞋</td>\n",
       "      <td>西安</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41307</th>\n",
       "      <td>直营商品专员</td>\n",
       "      <td>False</td>\n",
       "      <td>ABC童装童鞋</td>\n",
       "      <td>西安</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41308</th>\n",
       "      <td>ABC诚聘商品专员</td>\n",
       "      <td>False</td>\n",
       "      <td>ABC童装童鞋</td>\n",
       "      <td>西安</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>66766 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                job  是否为数据分析岗位                  company city  salary_min  \\\n",
       "859           数据分析师       True  （CCE GROUP）上海程迈文化传播有...   上海     15000.0   \n",
       "50689        资深媒介专员      False  （CCE GROUP）上海程迈文化传播有...   上海      6000.0   \n",
       "23092  产品运营经理（教育行业）      False                     龙的股份   上海      5000.0   \n",
       "4113      教务助理/教务人员      False             鼓动商贸（上海）有限公司   上海      4000.0   \n",
       "27576          教务专员      False             鼓动商贸（上海）有限公司   上海      5000.0   \n",
       "...             ...        ...                      ...  ...         ...   \n",
       "39420          商品经理      False                  ABC童装童鞋   西安      6000.0   \n",
       "39717        急聘商品专员      False                  ABC童装童鞋   西安      4000.0   \n",
       "39719          商品主管      False                  ABC童装童鞋   西安      4000.0   \n",
       "41307        直营商品专员      False                  ABC童装童鞋   西安      4000.0   \n",
       "41308     ABC诚聘商品专员      False                  ABC童装童鞋   西安      4000.0   \n",
       "\n",
       "       salary_max  新增列  \n",
       "859       20000.0  yes  \n",
       "50689      8000.0  yes  \n",
       "23092      8000.0  yes  \n",
       "4113       7000.0  yes  \n",
       "27576      6500.0  yes  \n",
       "...           ...  ...  \n",
       "39420      8000.0  yes  \n",
       "39717      6000.0  yes  \n",
       "39719      8000.0  yes  \n",
       "41307      6000.0  yes  \n",
       "41308      6000.0  yes  \n",
       "\n",
       "[66766 rows x 7 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_jobs.sort_values(by=[\"city\", \"company\"], ascending=[True, False], axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(102, 3)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfAdRaw = pandas.read_csv('2020ad-1102.csv')\n",
    "dfAdRaw.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "dfAd = dfAdRaw.drop_duplicates('姓名',keep='last')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(84, 3)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfAd.shape"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
  },
  "kernelspec": {
   "display_name": "Python 3.9.1 64-bit",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
